<template>
	<view class="moment-container">
		<scroll-view scroll-y="true" class="moment-list">
			<view class="moment-item" v-for="mom in momentList" :key="mom.id">
				<view class="moment-content-wrap" @click="toAnnounceMentDetail(mom)">
					<view class="content-title">
						{{mom.title}}
					</view>
					<view class="content-detail ellipsis2">
						{{mom.content}}
					</view>
					<view class="content-img-wrap" v-if="mom.imgList">
						<uni-row :gutter="16">
							<uni-col :span="8" v-for="(img, index) in mom.imgList" :index="index" :key="index">
								<image :src="img" mode="aspectFit" class="content-img-item"></image>
							</uni-col>
						</uni-row>
					</view>
					<view class="content-time">
						{{mom.time}}
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import commonUtils from '@/common/util/common.js'
	export default {
		data() {
			return {
				momentList: [{
					id: '123',
					title: '工作通知',
					content: '一、加强管理守法经营。二、切实做好安全生产工作，严格落实安全生产主体责任，严格落实“日周店铺贼大、客户贼多，有意者电联',
					time: '2022-12-30 19:00',
					imgList: [require('@/static/store/moments/1.png'), require('@/static/store/moments/2.png'), require('@/static/store/moments/3.png')]
				}, {
					id: '123',
					title: '工作通知',
					content: '一、加强管理守法经营。二、切实做好安全生产工作，严格落实安全生产主体责任，严格落实“日周店铺贼大、客户贼多，有意者电联',
					time: '2022-12-30 19:00',
					imgList: [require('@/static/store/moments/1.png'), require('@/static/store/moments/2.png'), require('@/static/store/moments/3.png')]
				}, {
					id: '123',
					title: '工作通知',
					content: '一、加强管理守法经营。二、切实做好安全生产工作，严格落实安全生产主体责任，严格落实“日周店铺贼大、客户贼多，有意者电联',
					time: '2022-12-30 19:00',
					imgList: [require('@/static/store/moments/1.png'), require('@/static/store/moments/2.png'), require('@/static/store/moments/3.png')]
				}, {
					id: '123',
					title: '工作通知',
					content: '一、加强管理守法经营。二、切实做好安全生产工作，严格落实安全生产主体责任，严格落实“日周店铺贼大、客户贼多，有意者电联',
					time: '2022-12-30 19:00',
					imgList: [require('@/static/store/moments/1.png'), require('@/static/store/moments/2.png'), require('@/static/store/moments/3.png')]
				}, {
					id: '123',
					title: '工作通知',
					content: '一、加强管理守法经营。二、切实做好安全生产工作，严格落实安全生产主体责任，严格落实“日周店铺贼大、客户贼多，有意者电联',
					time: '2022-12-30 19:00',
					imgList: [require('@/static/store/moments/1.png'), require('@/static/store/moments/2.png'), require('@/static/store/moments/3.png')]
				}, {
					id: '123',
					title: '工作通知',
					content: '一、加强管理守法经营。二、切实做好安全生产工作，严格落实安全生产主体责任，严格落实“日周店铺贼大、客户贼多，有意者电联',
					time: '2022-12-30 19:00',
				}]
			}
		},
		onLoad() {
			commonUtils.loadFont();
		},
		methods: {
			toAnnounceMentDetail(item) {
				uni.navigateTo({
					url: '/pages/store/announcement/detail'
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.moment-container {
		font-family: 'PingFangSc';
		font-weight: 400;
		padding: 18upx 32upx;
		height: 100%;

		.moment-list {
			height: calc(100% - 36upx);

			.moment-item {
				border-bottom: 1px solid #F0F0F0;
				margin-bottom: 38upx;

				.user-info-wrap {
					display: flex;
					align-items: center;
					color: rgb(31, 113, 175);
					font-size: 32upx;

					.moment-avatar {
						width: 44upx;
						height: 44upx;
						border-radius: 8upx;
						margin-right: 12upx;
					}
				}

				.moment-content-wrap {
					margin: 28upx 0 20upx;
					color: #141416;

					.content-title {
						font-size: 36upx;
					}

					.content-detail {
						font-size: 30upx;
						margin-top: 24upx;
					}

					.content-img-wrap {
						display: flex;

						uni-grid {
							width: 100%;
						}

						.content-img-item {
							width: 215upx;
							height: 220upx;
							border-radius: 8upx;
							border: 1px solid #F2F4F7;
						}
					}

					.content-time {
						color: #7E7E7E;
						font-size: 24upx;
						margin-top: 18upx;
					}
				}
			}
		}
	}
</style>
